/*
 *  egt.cpp
 *  framework
 *
 *  Created by gerhard gubler on 23.11.09.
 *  Copyright 2009 md80.ch . All rights reserved.
 *
 */

#include "egt.h"
#include <string>

using std::string;

void egt::init()
{
	egtscr.init();
	mfunc.set_num_textures(1);
	mfunc.set_Texture_name((string)"egt_gauge_bitmap.bmp");
	mfunc.setup_textures(256,256,1);
}

void egt::display(GLfloat posx, GLfloat posy)
{
	mfunc.showtexture(posx+23, posy +10, 0);
	egtscr.display2(posx, posy, egtVal);
	mfunc.box3(posx, posy+20, 25, 25);
	mfunc.box3(posx+25, posy+30, 20, 15);
	mfunc.box3(posx, posy-50, 25, 48);
	mfunc.box3(posx+25, posy-50, 22, 38);
	mfunc.line(posx + 25, posy + 10, 0,(egtVal / 5));

}

void egt::setegtval(float val)
{
	if (val > 143)
	egtVal = val-143;
	else egtVal = 0.0;
}
